package base

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

var R Response = Response{}

func (r Response) Success(data interface{}) Response {
	r.Code = 200
	r.Message = "success"
	r.Data = data
	return r
}

func (r Response) Error(message string) Response {
	r.Code = 500
	r.Message = message
	return r
}
